<?php
/*
 * Created on 31.01.2006
 *
 */

class conf_validatorHandler
{

    function startElement (& $sender, $attrs)
    {
        if (empty($attrs['name']))
        {
            die("Attribute name is required in tag conf:validator!");
        }
        if (empty($attrs['class']))
        {
            die("Attribute class is required in tag conf:validator!");
        }
        if (empty($attrs['method']))
        {
            die("Attribute method is required in tag conf:validator!");
        }
        if (empty($attrs['param']))
        {
            $attrs['param'] = "''";
        }
        $sender->appendCode('$validators['.$attrs['name'].'] = array("class" => '
            .$attrs['class'].', "method" => '.$attrs['method'].', "param" => '.$attrs['param'].');'."\n");
    }
    
    function endElement (& $sender)
    {
    }

} 

?>
